import { network } from '@/utils';
import { TableListParams, longLinkConfigParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryCabinetManagementList(params: TableListParams) { // 获取列表
  return network.get(basic.cab_list, { params });
}

export async function queryCabHWareVersion() { // 获取列表
  return network.get(basic.other_cabHWareVersion);
}

export async function queryGardenList(params: any) { // 获取小区学校
  params = { ...params, pageIndex: 1, pageSize: 10000 };
  return network.get(basic.garden_list, { params });
}

export async function operDisable(params: { id: number }) { // 禁用操作
  return network.put(basic.cab_disable, { data: params });
}

export async function queryLongConfig(params: { code: string }) { // 查询长链配置
  return network.get(basic.cab_config, { params });
}

export async function operLongLinkConfig(params: longLinkConfigParams) {
  return network.post(basic.cab_config, { data: params });
}

export async function operactionSeting(params: any) {
  const { pathName, ...query } = params;
  return network.post(basic[pathName], { data: query });
}

export async function operationCabreload(params: any) {
  return network.post(basic.cab_reboot, { data: params });
}
